﻿using ZBJF.Warranty.Common.Common;

namespace ZBJF.Warranty.Common.Enums.System
{
    /// <summary>
    /// 返回消息
    /// </summary>
    public class ResponseResult
    {
        /// <summary>
        /// 添加、修改成功，如不设置提示消息，则默认有提示消息
        /// </summary>
        public bool Success { get; set; }
        private string _message;
        /// <summary>
        /// 提示消息默认添加、修改成功、失败
        /// </summary>
        public string Message
        {
            get
            {
                return (_message ?? (Success ? string.Format("{0}成功！", EnumHelper.Instance.GetDescription(typeof(OpreateType), OpreateType)) : string.Format("{0}失败！", EnumHelper.Instance.GetDescription(typeof(OpreateType), OpreateType))));
            }
            set { _message = value; }
        }
        /// <summary>
        /// 新增、修改、删除
        /// </summary>
        public OpreateType OpreateType { get; set; }
    }
}